package top.hours48.ddbearapi.model.exception;

import lombok.Getter;

@Getter
public class BusinessException extends RuntimeException {
    private Integer code;
    private String msg;

    // 手动设置异常
    public BusinessException(BusinessCode businessCode) {
        // 状态码
        this.code = businessCode.getCode();
        // 状态码配套的msg
        this.msg = businessCode.getMsg();
    }

    // 手动设置异常
    public BusinessException(Integer statusCode, String message) {

        super(message);
        // 状态码
        this.code = statusCode;
        // 状态码配套的msg
        this.msg = message;
    }


}
